UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uPdWEmqaFgzPuW0J3zJplo1gtqQY8PoLDcL5VxCYzow=' 
WHERE 
  key_id = '7558efec35c209937bf1b518f01bc21bec137f09863c4ffcfe49cb04490321c0' 
  AND (
    token = 'uPdWEmqaFgzPuW0J3zJplo1gtqQY8PoLDcL5VxCYzow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027