UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x1mo6TUulsSqDakHAquzpe8CnBfIziU/ybnQt6/axyE=' 
WHERE 
  key_id = '94cc9a1214da9f3531d17378a7fabe70b82dc1fe91b91cf4d8e200f6cf671ae4' 
  AND (
    token = 'x1mo6TUulsSqDakHAquzpe8CnBfIziU/ybnQt6/axyE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030