UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bAJxOBvEzyeFHCEWXbDA4Or7szNMtHKggL1jhnQ9jyQ='
WHERE
key_id = '66c670a9a26b3012061af09058891614393dd576ac01fb10d35345e3781bb9b8'
AND (
token = 'bAJxOBvEzyeFHCEWXbDA4Or7szNMtHKggL1jhnQ9jyQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)