UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WXFls0gyjYMT5B90e3XXHj/vOyhdThPY3V6qNhyaeJE='
WHERE
key_id = 'ce4c1cf6dc942b40fc03245dd9490674f77aab8dfc301d08c43b787b0f7f28ae'
AND (
token = 'WXFls0gyjYMT5B90e3XXHj/vOyhdThPY3V6qNhyaeJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)