UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7UQMtvWYre3+J4Qmuu9DuK86B/aPq4UXs4g/N1A7S6o=' 
WHERE 
  key_id = 'b4c4bceaf7014c0bc09be43c1356c400f31c9611a61a287e7c94a00e63d93e1b' 
  AND (
    token = '7UQMtvWYre3+J4Qmuu9DuK86B/aPq4UXs4g/N1A7S6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040