UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pBU07AgsbT/Hliz/DVNVNfECjW2R0v77OiedYXA/cyc='
WHERE
key_id = 'bbd2f5b9e25eb311bfdd7d75f11b823d1cb9b7030e91a455506e3cd60d8a2068'
AND (
token = 'pBU07AgsbT/Hliz/DVNVNfECjW2R0v77OiedYXA/cyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)