UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qns1V61e1929HTQwVgYKTBFh6Nbn8u0Rc9Y6rOHD/jo=' 
WHERE 
  key_id = '09efc8d1e4e946921da1840caccf10a817e227ebc04b4c3171fa3528450cb9b9' 
  AND (
    token = 'Qns1V61e1929HTQwVgYKTBFh6Nbn8u0Rc9Y6rOHD/jo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022