UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X+QKGKr57/U8yOGlZCMnpXDWyA95ArjMONKzhvtMTQw=' 
WHERE 
  key_id = 'e4973c89ebc9aa9fd2bb5c1a5617b07670c4ec45293b052a3939ea111fbe04c9' 
  AND (
    token = 'X+QKGKr57/U8yOGlZCMnpXDWyA95ArjMONKzhvtMTQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049