UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qwiQw+b9Jcz0ebpesXLQV+xm/q40UHL6V9VcIl3AJCk=' 
WHERE 
  key_id = '4be66c260b7a7d66f2c696ec0e77dc9cc3fa4dd952b8f18c6a9b5b221f09ef7e' 
  AND (
    token = 'qwiQw+b9Jcz0ebpesXLQV+xm/q40UHL6V9VcIl3AJCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055