UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kDCY9hv9uwWVh8d7SMG5RDR73MGqBBWc7uEpFgHWqw8='
WHERE
key_id = 'dee2010a45a87d98fc712b3955be84297b076e41cd0f1525fbe679bdf5eb7db3'
AND (
token = 'kDCY9hv9uwWVh8d7SMG5RDR73MGqBBWc7uEpFgHWqw8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)