UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '383K+4BtrvFF3Oqc9stY+8S3oc/bv0uAZYKl0Ltbp/0='
WHERE
key_id = '6f86ba475fd08de5bd98b764e81436b7bfd21047c76f3ea8c2c8b71037c21203'
AND (
token = '383K+4BtrvFF3Oqc9stY+8S3oc/bv0uAZYKl0Ltbp/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)