UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GAkz2oU9OCrv/vfJb8j0uOOoRMXQg66/gf+YFcQRD/s='
WHERE
key_id = 'ee14f7aa58895594c7cf70c8dbe7e54641f4084cc332d7f547c3e511a86a4a5b'
AND (
token = 'GAkz2oU9OCrv/vfJb8j0uOOoRMXQg66/gf+YFcQRD/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)