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