UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+wBtfLDXdHibYWBR+tWxsq2ah1OBmaGVYhZpDoZcSM4='
WHERE
key_id = 'e9ce4ed28acb423bb8a78bfd3faf827e7722c23fd4bdbd85e0b7b502aa8e8535'
AND (
token = '+wBtfLDXdHibYWBR+tWxsq2ah1OBmaGVYhZpDoZcSM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)