UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BMPPg/whfUEmizxQaTF95sMJ4KeESGX1BVgrVMG4Opc='
WHERE
key_id = 'b8bbc4e3ffd81e10b35ea2143c21d752d419b221938d694f92ab7e93c655fb4b'
AND (
token = 'BMPPg/whfUEmizxQaTF95sMJ4KeESGX1BVgrVMG4Opc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)