UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u1e3E7IodVOAebPX9jP4a21W0VMvkk+5/E3MJxiR2AM='
WHERE
key_id = '521a76d04ca3559d86c6eca1585550176c2b05c6bd7d14a5dfc392406d11449d'
AND (
token = 'u1e3E7IodVOAebPX9jP4a21W0VMvkk+5/E3MJxiR2AM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)