UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '37XewZH+mT8eMKQTVKidw8nsNTdW9FG5++22vPt1a8I=' 
WHERE 
  key_id = '3bdfdb35e8ac31017db2ecf9d9e9cdacb2f5af07fb76cb380bbef54b3d30ad62' 
  AND (
    token = '37XewZH+mT8eMKQTVKidw8nsNTdW9FG5++22vPt1a8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024