UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rq1HS22kXo6Ry+TGkDwepr48j7V24Q7HBF6nXiTrazY=' 
WHERE 
  key_id = 'dec57b6d0574a9c4d647f4f3798a106f40809cd5fde4a69bb82fcced5cbf3655' 
  AND (
    token = 'rq1HS22kXo6Ry+TGkDwepr48j7V24Q7HBF6nXiTrazY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044