UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sq6Hk9FPPKFo7s5ZkAWDHEaXbFkNY9XTWa/wxPhc3EE='
WHERE
key_id = '16105dce42e613ba65045b94b443ecfe157c01a0c5f5c725d5a10a007b6e8757'
AND (
token = 'Sq6Hk9FPPKFo7s5ZkAWDHEaXbFkNY9XTWa/wxPhc3EE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)