UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hZ56zjEhBA7oZDwLvi7X4ZRpIeDxbUZOTo3h5PQ2BIQ='
WHERE
key_id = '5619fe4d29cf67c92f78f6b69b9b42e8d6d162a00d7bed012984dce4705e846d'
AND (
token = 'hZ56zjEhBA7oZDwLvi7X4ZRpIeDxbUZOTo3h5PQ2BIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)