UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3fvE6bS3PpdHAXUrlD6VskLp0Hv68oDE41MJbp05HXE='
WHERE
key_id = 'dfe610e644fde03df2bc55217e642d81e75376910425d02a45266c503d00cefd'
AND (
token = '3fvE6bS3PpdHAXUrlD6VskLp0Hv68oDE41MJbp05HXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)