UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IXR2+o72/9sFcf5+QnFptHjsALJ2Afpv4Vw9MD7xkEY=' 
WHERE 
  key_id = 'fad92ce0ea81a4ff058f4abe6a2891a98395369d7ff7081fd1fb9f1dc184b626' 
  AND (
    token = 'IXR2+o72/9sFcf5+QnFptHjsALJ2Afpv4Vw9MD7xkEY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021