UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tCgFMdig4mW+J6Yb8dndBlm5b/ysWuiakIchqC0OjtA='
WHERE
key_id = '094fd317940f27780c4f06adf290d31815ce1e21ce7e02b1bcfa2ba804cd490b'
AND (
token = 'tCgFMdig4mW+J6Yb8dndBlm5b/ysWuiakIchqC0OjtA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)