UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1iRUPex6KatuKGKgdtbon72gQ6jCHEFuUQLQ/ZlgMMc='
WHERE
key_id = 'efce9ccb293d1664c00902c1ba3bc8b75bd411109b198d04bc05b67ffb95575c'
AND (
token = '1iRUPex6KatuKGKgdtbon72gQ6jCHEFuUQLQ/ZlgMMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)