UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1a1mCu9NhEldMIX90xWIk+6TQVBD8/4jDJnjFy9A7EI=' 
WHERE 
  key_id = '91393e36641525505c17f55136179214459711de51879a32066d2aeae56611fc' 
  AND (
    token = '1a1mCu9NhEldMIX90xWIk+6TQVBD8/4jDJnjFy9A7EI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017