UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bSkV3fCItuFztN/xAy/QOadJxmFXiI+fPb7AGwYuGUU=' 
WHERE 
  key_id = 'efb6140e32f98d1a241e522bfaf51c43bdcec8a10e2cd72ae02f34f06d2a641c' 
  AND (
    token = 'bSkV3fCItuFztN/xAy/QOadJxmFXiI+fPb7AGwYuGUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034