UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6EOaFqxiWLh86J/G4GiYD86TekC7rS/NmAJObAuV754='
WHERE
key_id = '733dab62654ab5e5872f734e7c0b148d8bdb8bcdfcfe288202691cb3d286d24f'
AND (
token = '6EOaFqxiWLh86J/G4GiYD86TekC7rS/NmAJObAuV754='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)